<table >
	<tr><th>活动名称</th><th>活动描述</th><th>组织者</th><th>参与者（人数）</th><th>活动时间</th><th>操作</th></tr>
	<?php foreach ($events as $event): ?>
	<tr><td><?php echo $html->link($event['Event']['name'],"/events/view/{$event['Event']['id']}") ?></td>
		<td><?php echo $event['Event']['description'] ?></td>
		<td>
		<?php 
		foreach ($event['EventUser'] as $eventUser) {
			if ($eventUser['role']==EventUser::sponsor) {
				foreach ($event['User'] as $user) {
					if ($user['id']==$eventUser['user_id']) {
						 echo $linker->userLink($user); 
					}
				}
			};
		}
		 ?>
	</td>
		<td>
			<?php foreach ($event['User'] as $user): ?>
				<?php echo $linker->userManageLink($user) ?> |
			<?php endforeach ?>
			
		</td>
		<td>
			
		</td>
		<td>
			<?php echo $html->link('删除', '/manage/delete_event'."?id={$event['Event']['id']}") ?>
		</td>
	</tr>		
	<?php endforeach ?>

</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
|
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>